package tool

import "fmt"

func TansferRetMap(ww interface{}, ss string) map[string]interface{} {
	t, error := ww.(map[string]interface{})
	fmt.Println(error)
	for k, v := range t {
		switch v2 := v.(type) {
		case map[string]interface{}:
			if k == ss {
				zz := v2
				return zz
			}
		}
	}
	return nil
}
func TansferRetList(ww map[string]interface{}, ss string) []interface{} {
	for k, v := range ww {
		switch v2 := v.(type) {
		case []interface{}:
			if k == ss {
				zz := v2
				return zz
			}
		}
	}
	return nil
}

func TansferRetString(ww map[string]interface{}, ss string) string {
	for k, v := range ww {
		switch v2 := v.(type) {
		case string:
			if k == ss {
				zz := v2
				return zz
			}
		}
	}
	return "nil"
}

func TansferRetInt(ww map[string]interface{}, ss string) int {
	for k, v := range ww {
		switch v2 := v.(type) {
		case int:
			if k == ss {
				zz := v2
				return zz
			}
		}
	}
	return 0
}
